@import "mixins";
@import "themes/default";

.placeholder {
  color: $input-color-placeholder;
}

.input {
  padding: $input-padding-y $input-padding-x;
  font-size: $font-size-base;
  line-height: $input-line-height;
  color: $input-color;
  background-color: $input-bg;
  // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214.
  background-image: none;
  background-clip: padding-box;
  border: $input-btn-border-width solid $input-border-color;
  @include border-radius($input-border-radius);
  @include box-shadow($input-box-shadow);
  @include transition(border-color ease-in-out .15s, box-shadow ease-in-out .15s);

  // Customize the `:focus` state to imitate native WebKit styles.
  @include form-control-focus();
  vertical-align: middle;

  // Placeholder
  &::placeholder {
    color: $input-color-placeholder;
    // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
    opacity: 1;
  }
}

.dangerInput {
  //color: $brand-danger;
  border-color: $brand-danger;
}

.small {
  padding: $input-padding-y-sm $input-padding-x-sm;
  font-size: $font-size-sm;
  @include border-radius($input-border-radius-sm);
}

.large {
  padding: $input-padding-y-lg $input-padding-x-lg;
  font-size: $font-size-lg;
  @include border-radius($input-border-radius-lg);
}

.disabled,
.readonly,
.input:disabled,
.disabled .input {
  cursor: $cursor-disabled;
  background-color: $input-bg-disabled;
}

.hasError {
  border-color: $brand-danger;
}

// input-group
.group {
  position: relative;
  width: 100%;

  @if $enable-flex {
    display: flex;
  } @else {
    display: table;
    // Prevent input groups from inheriting border styles from table cells when
    // placed within a table.
    border-collapse: separate;
  }

  .input {
    // Ensure that the input is always above the *appended* addon button for
    // proper border colors.
    position: relative;
    z-index: 2;
    // Bring the "active" form control to the front
    @include hover-focus-active {
      z-index: 3;
    }
    @if $enable-flex {
      flex: 1;
    } @else {
      // IE9 fubars the placeholder attribute in text inputs and the arrows on
      // select elements in input groups. To fix it, we float the input. Details:
      // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855
      float: left;
      width: 100%;
    }
    margin-bottom: 0;
  }
}

/*
.addon,
.btn,
.input {
  @if not $enable-flex {
    display: table-cell;
  }

  &:not(:first-child):not(:last-child) {
    @include border-radius(0);
  }
}
*/


//
// Text input groups
//

.addon {
  padding: $input-padding-y $input-padding-x;
  margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom
  font-size: $font-size-base;
  font-weight: normal;
  line-height: $input-line-height;
  color: $input-color;
  text-align: center;
  background-color: $input-group-addon-bg;
  border: $input-btn-border-width solid $input-group-addon-border-color;
  @include border-radius($input-border-radius);

  // Sizing
  &.small {
    padding: $input-padding-y-sm $input-padding-x-sm;
    font-size: $font-size-sm;
    @include border-radius($input-border-radius-sm);
  }
  &.large {
    padding: $input-padding-y-lg $input-padding-x-lg;
    font-size: $font-size-lg;
    @include border-radius($input-border-radius-lg);
  }

  // scss-lint:disable QualifyingElement
  // Nuke default margins from checkboxes and radios to vertically center within.
  input[type="radio"],
  input[type="checkbox"] {
    margin-top: 0;
  }
}


//
// Reset rounded corners
//
.group {
  .btn,
  .addon {
    @if not $enable-flex {
      width: 1%;
    }
    white-space: nowrap;
    vertical-align: middle; // Match the inputs
  }

  .input:not(:last-child),
  .addon:not(:last-child),
  .btn:not(:last-child),
  .groupBtn:not(:last-child) > .dropdown-toggle {
    @include border-right-radius(0);
  }
  .btn:not(:last-child),
  .addon:not(:last-child) {
    border-right: 0;
  }
  .input:not(:first-child),
  .addon:not(:first-child),
  .btn:not(:first-child),
  .groupBtn:not(:first-child) > .dropdown-toggle {
    @include border-left-radius(0);
  }

  .btn:not(:first-child),
  .input + .addon:not(:first-child) {
    border-left: 0;
  }
}
